home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb-4.5 / dist / libiberty / Makefile.in < prev    next >
Encoding:
Makefile  |  1992-03-25  |  5.0 KB  |  175 lines

  1. #
  2. # Makefile
  3. #   Copyright (C) 1990, 1991, 1992 Free Software Foundation
  4. #
  5. # This file is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16. #
  17.  
  18. # This file was written, and is maintained by K. Richard Pixley
  19. # <rich@cygnus.com>.
  20.  
  21. #
  22. # Makefile for libiberty directory
  23. #
  24.  
  25. srcdir = .
  26.  
  27. prefix = /usr/local
  28.  
  29. exec_prefix = $(prefix)
  30. bindir = $(exec_prefix)/bin
  31. libdir = $(exec_prefix)/lib
  32.  
  33. datadir = $(prefix)/lib
  34.  
  35. mandir = $(prefix)/man
  36. man1dir = $(mandir)/man1
  37. man2dir = $(mandir)/man2
  38. man3dir = $(mandir)/man3
  39. man4dir = $(mandir)/man4
  40. man5dir = $(mandir)/man5
  41. man6dir = $(mandir)/man6
  42. man7dir = $(mandir)/man7
  43. man8dir = $(mandir)/man8
  44. man9dir = $(mandir)/man9
  45. infodir = $(prefix)/info
  46. includedir = $(prefix)/include
  47. oldincludedir =
  48. docdir = $(datadir)/doc
  49.  
  50. SHELL = /bin/sh
  51.  
  52. INSTALL = install -c
  53. INSTALL_PROGRAM = $(INSTALL)
  54. INSTALL_DATA = $(INSTALL)
  55.  
  56. AR = ar
  57. AR_FLAGS = qv
  58. BISON = bison
  59. MAKEINFO = makeinfo
  60. RANLIB = ranlib
  61.  
  62. TARGETLIB = libiberty.a
  63.  
  64. MINUS_G = -g
  65. CFLAGS = $(MINUS_G) -I. -I$(srcdir)/../include $(HDEFINES)
  66.  
  67. # HOST_OFILES contains the list of objects that should be in the
  68. # library (in addition to the REQUIRED_OFILES and EXTRA_OFILES).
  69. # A configuration may override this with a fixed list a object files
  70. # names (hard to maintain), or some other way to generate a list.
  71. HOST_OFILES=`cat needed-list`
  72.  
  73. # Extra targets that the top-level target depends on.
  74. # Specifically, what needs to be made before HOST_OFILES can be used.
  75. # Can be empty if HOST_OFILES is just a list of file names.
  76. DO_ALSO = needed-list
  77.  
  78. # A configuration can specify extra .o files that should be included,
  79. # even if they are in libc. (Perhaps the libc version is buggy.)
  80. EXTRA_OFILES = 
  81.  
  82. all:    $(TARGETLIB)
  83. .PHONY: check
  84. check:
  85.  
  86.  
  87. #### Host, target, and site specific Makefile fragments come in here.
  88. ###
  89.  
  90. # The default target just invokes make recursively.
  91. # However, the automatic configuration (in config/mh_default).
  92. # first causes it to figure out the objects missing in libc.
  93. info install-info clean-info:
  94.  
  95. # NOTE: If you add new files to the library, edit 'functions.def'.
  96. CFILES = basename.c bcmp.c bcopy.c bzero.c getopt.c getopt1.c getpagesize.c \
  97.     getcwd.c index.c insque.c obstack.c rindex.c spaces.c \
  98.     memcmp.c memcpy.c memmove.c memset.c strchr.c strrchr.c \
  99.     strdup.c strerror.c strstr.c strtol.c strtoul.c vfork.c \
  100.     vfprintf.c vprintf.c vsprintf.c sigsetmask.c concat.c fdmatch.c \
  101.     argv.c alloca.c
  102. # These are always included in the library.
  103. REQUIRED_OFILES = basename.o getopt.o getopt1.o obstack.o spaces.o concat.o \
  104.     fdmatch.o argv.o
  105.  
  106. # Do we want/need any config overrides?
  107. #     
  108.  
  109. STAGESTUFF = $(TARGETLIB) *.o
  110.  
  111. install: all
  112.     $(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB).n
  113.     $(RANLIB) $(libdir)/$(TARGETLIB).n
  114.     mv -f $(libdir)/$(TARGETLIB).n $(libdir)/$(TARGETLIB)
  115.  
  116. # The default configuration adds to libiberty all those functions that are
  117. # missing in libc.  More precisely, it includes whatever $(CC) fails to find.
  118. # Then a sed+awk combination translates the ld error messages into
  119. # a list of .o files.
  120.  
  121. needed-list: $(srcdir)/dummy.c $(EXTRA_OFILES) needed.awk
  122.     $(CC) $(CFLAGS) -c $(srcdir)/dummy.c
  123.     -($(CC) $(LDFLAGS) dummy.o $(EXTRA_OFILES) $(LOADLIBES)) >errors 2>&1 || true
  124.     awk -f needed.awk <errors >needed-list
  125.     -rm -f a.out errors dummy.o
  126.  
  127. # Generate an awk script that looks for functions in functions.def
  128.  
  129. needed.awk: $(srcdir)/functions.def
  130.     echo "# !Automatically generated from $(srcdir)/functions.def"\
  131.       "- DO NOT EDIT!" >needed.awk
  132.     grep '^DEF(' < $(srcdir)/functions.def \
  133.         | sed -e '/DEF/s|DEF.\([^,]*\).*|/\1/ { printf \" \1\.o" }|' \
  134.         >>needed.awk
  135.  
  136. RULE1 = $(TARGETLIB)
  137. $(RULE1): $(REQUIRED_OFILES) $(DO_ALSO) .always.
  138.     $(MAKE) RULE1=not-used RULE2=$(TARGETLIB) \
  139.          HOST_OFILES="$(HOST_OFILES)"\
  140.         "CC=$(CC)" "CFLAGS=$(CFLAGS)" \
  141.         "AR=$(AR)" "AR_FLAGS=$(AR_FLAGS)" "RANLIB=$(RANLIB)"
  142.  
  143. # Rule invoked by recursive make in $(RULE1).
  144. RULE2 = not-used
  145. $(RULE2): $(REQUIRED_OFILES) $(HOST_OFILES) $(EXTRA_OFILES)
  146.     rm -rf $(TARGETLIB)
  147.     $(AR) $(AR_FLAGS) $(TARGETLIB) \
  148.       $(REQUIRED_OFILES) $(HOST_OFILES) $(EXTRA_OFILES)
  149.     $(RANLIB) $(TARGETLIB)
  150.  
  151. .always.:
  152. # Do nothing.
  153.  
  154. .PHONEY: all etags tags ls clean stage1 stage2 .always.
  155.  
  156. etags tags: TAGS
  157.  
  158. TAGS: $(CFILES)
  159.     etags $(HFILES) $(CFILES)
  160.  
  161. ls:
  162.     @echo Makefile $(HFILES) $(CFILES)
  163.  
  164. # Need to deal with profiled libraries, too.
  165.  
  166. clean:
  167.     rm -f *.a *.o core errs *~ \#* TAGS *.E a.out needed.awk errors needed-list
  168.  
  169. force:
  170.  
  171. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  172.     $(SHELL) ./config.status
  173.